-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added hoist field transform package + docs #2862
Conversation
🦋 Changeset detectedLatest commit: c32c1be The changes in this PR will be included in the next version bump. This PR includes changesets to release 83 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This is an interesting transform, but it can only deal with field hoisting, whilst my replace-field transform is primarily designed to override schema bits and so hoisting there is mostly a side conveniency feature. I would personally avoid having two plugins that can achieve the same goal even if in different ways. I think I could start looking into that if we agree to go towards this path. BTW I like here the idea of renaming the field, I will most likely add that to replace-field, it feels very relevant. @ntziolis maybe you can have a look at what I did with replace-field and see if something like that would work for you. |
4b3d5c5
to
8e8006d
Compare
@santino Replace field seems significantly more powerful with the ability to hoist fields as well. Hence there is no need for a standalone hoist field transform anymore. Let me know if I can assist in creating a wrap mode version of your transform. |
Glad to hear that can work for you. Do you need wrap mode in order to start using the plugin? If there is a need for that, as a feature request, then I will start looking into it ASAP; otherwise, I will leave it for when I have more spare time. But keen to solve your use case, since you even created a PR for that. |
@santino We have been successfully using your transform. Here are some comments:
|
@ntziolis, your feedback is very relevant and I thank you for that! I have some comments but I am thinking that is probably best to close this issue, so you can open a new one focused on the replace-field transform. Let's keep going on a dedicated thread :) |
Closing as discussed |
c18e20d
to
76a4c50
Compare
Continuing discussion from here:
@santino For our use cases the support for glob pattern in the hoist field path would be immensely helpful. As of now the wrap transform leverages the |
@santino The existing When creating the bare version of hoist field we should ensure that lists in path are properly supported right from the start. |
faf42fd
to
a1c915a
Compare
d4bf5fb
to
42a138d
Compare
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/theguild/graphql-mesh/6UoiEAeJ1fy6tJQVaM9pJrPeLcGy |
Description
Added transform that enables hoisting of fields. Its a thin wrapper around the
HoistField
transform from the@graphql-tools/wrap
package.Fixes # (issue)
This PR provides a transform that can be used as a workaround for issue ardatan/graphql-tools#3562
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Added relevant unit tests for the package.
Test Environment:
@graphql-mesh/latest
:Checklist:
Further comments
Please let me know if there are any pieces missing to wire up the documentation with the website, since this this is the first time I'm adding an item vs just updatig.
We understand we could have just build our own package but felt this hoisting fields being a common across
graphql-mesh
users. If you feel this should be an independent package just let us know.